/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.storage.api;

import com.jeesite.modules.storage.service.CategoryService;
import com.jeesite.modules.storage.common.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 分类Controller
 */
@RestController(value = "apicategory")
@RequestMapping(value = "/api/category")
public class CategoryController extends APIController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 统计汇总【分类】
     * @param type 类型【Hot热播 Sale预告】
     * @param identity 标识【Today今日 Yesterday昨日 Earlier更早 Tomorrow明日 AfterTomorrow后日】
     * @return 统计汇总【分类】
     */
    @RequestMapping(method = RequestMethod.GET,value = "activity/query")
    @ResponseBody
    public ServerResponse<List<Map>> activityQuery(@RequestParam(value = "type")String type, @RequestParam(value = "identity")String identity){
        return ServerResponse.createBySuccess(200,categoryService.getActivities(type,identity));
    }
}